package com.jt.controller;

import com.jt.pojo.EasyUITree;
import com.jt.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author Song
 * @since 2020/11/3
 */
@RestController
@RequestMapping("/item/cat")
public class ItemCatController {


    @Autowired
    private ItemCatService itemCatService;


    @RequestMapping("/queryItemName")
    public String findItemNameById(Long  itemCatId){
        return itemCatService.findItemNameById(itemCatId).getName();
    }

    @RequestMapping("/list")
    public List<EasyUITree> findItemCatList(@RequestParam(value = "id",defaultValue = "0")Long id){
        return itemCatService.findItemCatList(id);
        //return itemCatService.findItemCache(id);
    }
}
